package cn.ynny.demo02;

public class student extends person{
    public String no;
    public double yingyu;
    public double shuxue;
    public double yuwen;

    public student() {
    }


    public student(String name, String sex, int age, String no, double yingyu, double shuxue, double yuwen) {
        super(name, sex, age);
        this.no = no;
        this.yingyu = yingyu;
        this.shuxue = shuxue;
        this.yuwen = yuwen;
    }
    public double pingju(){
        return (yingyu+shuxue+yuwen)/3;
    }
    public double max(){
        return Math.max(Math.max(yingyu,shuxue),yuwen);
    }
    public double min(){
        return Math.min(Math.min(yingyu,shuxue),yuwen);
    }

    @Override
    public String toString() {
        return "student{" +"name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                "no='" + no + '\'' +
                ", tingjum" + pingju() +
                ", max" + max() +
                ", min" + min() +
                '}';
    }
}
